#coding=utf-8
#第二题无穷序列1223334444...输出第几个数是几 s0<= i * (i+1)/2
import math
s0 = input()

'''
bit_dict = {}
for i in range(1, 100000):
    bit_dict[i] = i * (i+1)/2
if s0==1:print 1
else:
    for i in range(1,100000):
        if s0<=bit_dict[i] and s0>bit_dict[i-1]:
            print i
            break
        elif i>2 and s0==bit_dict[i-1]:
            print i-1
        else:
            pass
'''
print int(math.ceil(0.5*math.sqrt(1+8*s0)-0.5))